package com.jzo2o.customer.controller.operation;

import com.jzo2o.common.model.PageResult;
import com.jzo2o.customer.model.dto.request.AgencyCertificationAuditPageQueryReqDTO;
import com.jzo2o.customer.model.dto.response.AgencyCertificationAuditResDTO;
import com.jzo2o.customer.service.IAgencyCertificationAuditService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * @author itcast
 */
@RestController("operationAgencyCertificationAuditController")
@RequestMapping("/operation/agency-certification-audit")
@Api(tags = "机构端 - 机构人员审核信息相关接口")
public class AgencyCertificationAuditController {

    @Resource
    private IAgencyCertificationAuditService agencyCertificationAuditService;

    @GetMapping("/page")
    @ApiOperation("分页查询审核信息")
    public PageResult<AgencyCertificationAuditResDTO> pageList(AgencyCertificationAuditPageQueryReqDTO dto) {
        return agencyCertificationAuditService.pageList(dto);
    }

    @PutMapping("/audit/{id}")
    @ApiOperation("审核机构人员认证信息")
    public void audit(@RequestParam("certificationStatus") Integer certificationStatus,@PathVariable Long id,@RequestParam("rejectReason") String rejectReason) {
        agencyCertificationAuditService.audit(certificationStatus,id,rejectReason);
    }
}
